package com.polaris.live.adapter

import com.bumptech.glide.Glide
import com.polaris.live.common.adapter.BaseBindingAdapter
import com.polaris.live.common.adapter.VBViewHolder
import com.polaris.live.databinding.ItemTogetherDailyBinding
import com.polaris.live.resp.back_resp.UserConsumableDailyReward
import com.polaris.live.utils.image.ImageUtils

/**
 * TogetherDailyAdapter
 *
 * @author Created by 天晴 on 2024/7/17/015 17:13
 */
class TogetherDailyAdapter : BaseBindingAdapter<ItemTogetherDailyBinding, UserConsumableDailyReward>() {
    override fun convert(
        holder: VBViewHolder<ItemTogetherDailyBinding>,
        item: UserConsumableDailyReward,
    ) {
        holder.vb.apply {
            Glide.with(image.context)
                .load(ImageUtils.imgPath(item.icon))
                .into(image)

            titleTv.text = item.displayText
            diamondsTv.text = item.coin
            daysTv.text = item.dailyText
//            val yday = item.maxDays - item.days
//            if (yday > 0) {
//                daysTv.visibility = View.VISIBLE
//                daysTv.text = StringUtils.getString(R.string.you_can_claim_days, yday)
//            } else {
//                daysTv.visibility = View.GONE
//            }
        }
    }
}

